﻿using DevTool.Contraner;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DevTool
{
    public partial class Index : Form
    {
        static Hashtable hc = new Hashtable();
        public Index()
        {
            InitializeComponent();
            this.LoadControl(new httpControl());
        }

        /// <summary>
        /// 用户控件加载
        /// </summary>
        /// <param name="uc">有户控件</param>
        private void LoadControl(Control uc)
        {
            uc.Dock = DockStyle.Fill;
            this.IndexPage.Controls.Clear();
            if (hc[uc.Name] == null)
            {
                hc.Add(uc.Name, uc);
                this.IndexPage.Controls.Add(uc);
            }
            else
            {
                this.IndexPage.Controls.Add((Control)hc[uc.Name]);
            }

        }

        private void bt_http_Click(object sender, EventArgs e)
        {
            this.LoadControl(new httpControl());
        }

        private void bt_reg_Click(object sender, EventArgs e)
        {

            this.LoadControl(new ZhenZheControl());
        }

        private void bt_fy_Click(object sender, EventArgs e)
        {

            this.LoadControl(new FanYiUserControl());
        }

        private void bt_json_Click(object sender, EventArgs e)
        {

            this.LoadControl(new UserJsonControl());
        }

        private void bt_models_Click(object sender, EventArgs e)
        {

            this.LoadControl(new UserModelControl());
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.LoadControl(new BigFileReadControl());
        }

        private void bt_tobase64_Click(object sender, EventArgs e)
        {
            this.LoadControl(new FileBase64Control());
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.LoadControl(new ChatGpt());
        }

        private void bt_mysql_Click(object sender, EventArgs e)
        {
            this.LoadControl(new MySqlModelsControl());
        }
    }
}
